package com.qingfeng.core.dao.qingfeng;


import com.qingfeng.core.config.database.BaseMapper;
import com.qingfeng.core.dao.BaseDao;
import com.qingfeng.core.entity.qingfeng.Cash;
import com.qingfeng.core.mapper.qingfeng.CashMapper;
import com.qingfeng.core.utils.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * @description: 提现
 * @author:LWY
 * @date: 2017/10/16 17:15
 * @modified:
 */

@Repository
public class CashDao extends BaseDao<Cash> {

    @Autowired
    CashMapper cashMapper;

    @Override
    protected BaseMapper<Cash> getBaseMapper() {
        return cashMapper;
    }

    /**
     * 提现
     *
     * @param cash 提现记录
     */
    public void apply(Cash cash) {
        cash.setId(UuidUtil.generatorUUID());
        cash.setCreate_time(new Date());
        insert(cash);
    }
}
